<?php
   $path = "./path/folder/file.txt";
   $filename = basename($path); // $filename contains "users.txt"
   $filename2 = basename($path, ".txt"); // $filename2 contains "users"
   echo "$filename \n$filename2";
   
   $dirname = dirname($path);
   echo "dir: $dirname\n";				//./path/folder
   
   $pathinfo = pathinfo($path);
   echo "Dir name: $pathinfo[dirname]<br />\n";
   echo "Base name: $pathinfo[basename] <br />\n";
   echo "Extension: $pathinfo[extension] <br />\n";
   foreach ($pathinfo as $key => $value) {
   	echo "$key : $value , ";
   }
   echo "\n";
   
   $file = "C:/tmp/index.html";
   $bytes = filesize("$file"); // Returns 91815
   echo "File ".basename($file)." is $bytes bytes, or 
        ".round($bytes / 1024, 2)." kbytes.";
   
   
   
?>